//
//  XQIdentitySuccessView.m
//  JoinPeso
//
//  Created by 小琦 on 2024/11/23.
//

#import "XQIdentitySuccessView.h"

@interface XQIdentitySuccessView()
@property (nonatomic,strong) UILabel *titleLb;
@property (nonatomic,strong) UIView *contentView;
@property (nonatomic,strong) UIImageView *imageView;
@end

@implementation XQIdentitySuccessView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self makeUI];
        [self makeConstraints];
    }
    return self;
}

- (void)makeUI {
    [self addSubview:self.titleLb];
    [self addSubview:self.contentView];
    [self.contentView addSubview:self.imageView];
}

- (void)makeConstraints {
    [self.titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@0);
        make.left.equalTo(@12);
        make.height.mas_equalTo(22);
    }];
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@-12);
        make.top.equalTo(self.titleLb.mas_bottom).offset(10);
        make.height.mas_equalTo(150);
        make.bottom.equalTo(@0);
    }];
    [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        (void)make.center;
        make.width.equalTo(@179);
        make.height.equalTo(@113);
    }];
}

#pragma mark - setter

- (void)setImageName:(NSString *)imageName {
    self.imageView.image = [UIImage imageNamed:imageName];
}

#pragma mark - lazy

- (UILabel *)titleLb {
    if (!_titleLb) {
        _titleLb = [[UILabel alloc] init];
        _titleLb.textColor = kBlackTextColor;
        _titleLb.font = [UIFont boldSystemFontOfSize:16];
        _titleLb.text = @"Demonstration";
    }
    return _titleLb;
}

- (UIView *)contentView {
    if (!_contentView) {
        _contentView = [[UIView alloc] init];
        _contentView.backgroundColor = [UIColor whiteColor];
        _contentView.layer.cornerRadius = 20;
    }
    return _contentView;
}

- (UIImageView *)imageView {
    if (!_imageView) {
        _imageView = [[UIImageView alloc] init];
    }
    return _imageView;
}

@end
